<?php
include('../../inc/global.inc');
include("../islogin.php");
$id = intval($_GET['id']);
$row=$db->get_one("SELECT * FROM `sd_tuoguan` WHERE id=$id and status=2");
if(!$row){
 echo "<script>location='/err.html';</script>";
}
if(isset($_POST['submit']) && $_POST['submit'])
{
	$array2['guanliyuan']=$_SESSION['admin_user'];
	$array2['status'] = 3;//管理员确认收款
	$true = $db->update('sd_tuoguan', $array2,"id=".$_POST['info']['tuoguanid']);
	
	if($true)
	{
		
		echo "<script>alert('确认收款成功');location='index.php';</script>";exit;
	}
	else
	{
		echo "<script>alert('确认失败，未知原因。请联系管理员');location='".HTTP_REFERER."';</script>";exit;
	}
}
$row2=$db->get_one("SELECT * FROM `sd_dakuan` WHERE tuoguanid=$id");
?>
<HTML>
<HEAD>
<TITLE>Admin</TITLE>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<LINK href="../css/css.css" rel=stylesheet>
<script type='text/javascript' src="../js/islogin.js" charset="gb2312"></script>
<script src="../../js/jquery.js"></script>
</HEAD>
<BODY>
<center>
  <table width="95%" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">
    <tr>
      <td height="25" bgcolor="#EEEEF9" style="padding-left:5px;">管理员确定打款&nbsp;&nbsp;<a href="javascript:history.go(-1)">Back</a></td>
    </tr>
  </table>
  <div>
  		<br />
        <form action="" method="post" onsubmit="return check();">
               		<input type="hidden" name="info[tuoguanid]" value="<?php echo $id;?>" />
					<table width="100%" border="0" cellpadding="0" cellspacing="0" >
	                 <tr>
		                <td width="20%" height="30" align="center" bgcolor="#EFF6FF"> 买家汇款银行名称：</td>
	                <td colspan="2" bgcolor="#f9f9f9"><input name="info[bankname]" type="text" class="txt1" id="bankname" value="<?php echo $row2['bankname']?>"/> </td>                     
					</tr>
					<tr>
		                <td width="20%" height="30" align="center" bgcolor="#EFF6FF"> 买家汇款时间：</td>
	                <td colspan="2" bgcolor="#f9f9f9"><input name="info[dtime]" type="text" class="txt5" id="dtime" value="<?php echo date('Y-m-d H:i:s',$row2['inputtime']);?>"/> </td>                     
					</tr>
	                 <tr>
		                <td  height="30" align="center" bgcolor="#EFF6FF">买家汇款金额：</td>
		                <td colspan="2" bgcolor="#f9f9f9"><input name="info[price]" type="text" class="txt1" id="price" value="<?php echo $row2['price']?>"/>元</td>
	                </tr>
	                 <tr>
		                <td height="160" bgcolor="#EFF6FF" align="center">买家备注：</td>
		                <td width="79%" bgcolor="#f9f9f9"><?php echo $row2['content']?></td>
                    </tr>
	                 <tr>
		                <td height="45" bgcolor="#EFF6FF">&nbsp;</td>
		                <td colspan="2" bgcolor="#f9f9f9">&nbsp;
						<input name="submit" type="submit" id="submit" value=" 提交" class="btn1"/></td>
	                </tr>
                 </table></form>
  </div>
</center>
</BODY>
</HTML>
<script>
	function check()
	{
	}
</script>